﻿//use this for date formatting
function date(ndate) {
    ngdate = new Date(ndate);
    this.month = ('0' + (ngdate.getMonth() + 1)).slice(-2);
    this.day = ('0' + ngdate.getDate()).slice(-2);
    this.year = ngdate.getFullYear();
    this.normalDate =  this.month + '/'
         + this.day + '/'
         + this.year;
}

function convertDateToString(dateString) {
    try {
        if (dateString) {
            var dateValue = moment(dateString).format('MM/DD/YYYY');
            if (dateValue == '01/01/0001') {
                return '';
            }
            return dateValue;
        }
    }
    catch (e) {
    }
    return dateString;
}
